<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>hello 入门案例</title>
	</head>
	<body>
		<div id="app">
			<h1>今天天气{{info}}</h1>
			<button @click="changeWeather">切换天气</button>
			<hr/>
			<h3>a的值是{{numbers.a}}</h3>
			<button @click="numbers.a++">点我a+1</button>
			<h3>a的值是{{numbers.b}}</h3>
			<button @click="numbers.b++">点我b+1</button>
			
		</div>
		
		
		<!-- 引入js -->
		<script src="../js/vue.js"></script>
		<script type="text/javascript">
			const vm=new Vue({
				el:'#app',
				data:{
					isHot:true,
					numbers: {
						a:1,
						b:1
					}
				},
				computed:{
					info(){
						return this.isHot ? '炎热' : '凉爽'
					}
				},
				methods:{
					changeWeather(){
						this.isHot =!this.isHot
					}
				},
				watch:{

					isHot(newValue,oldValue){
						console.log('isHot被修改了',newValue,oldValue)
					}


				}
			})


		</script>
	</body>
</html>
